<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdvContentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('adv_contents', function (Blueprint $table) {
            $table->increments('id')->comment('广告内容表');
            $table->integer('adv_type_id')->comment('广告分类ID')->default(0);
            $table->string('adv_name', 255)->nullable()->comment('广告名称');
            $table->string('adv_img', 255)->nullable()->comment('广告图片');
            $table->string('adv_img_pc', 255)->nullable()->comment('PC端广告位图片');
            $table->tinyInteger('adv_type')->nullable()->comment('类型（1文章；2调查问卷；3地址;4商品）')->default(0);
            $table->integer('obj_id')->nullable()->comment('目标ID')->default(0);
            $table->integer('sort')->nullable()->comment('排序')->default(0);
            $table->tinyInteger('is_show')->nullable()->comment('展示状态')->default(0);
            $table->string('url', 255)->comment('跳转地址')->nullable();
            $table->integer('region_id')->comment('所属地区ID（1.北洸村）')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('adv_contents');
    }
}
